<?php

class TopicView
{
	public function RenderTopicList(TopicArray $topicArray)
	{
		$ret = "<ul>";
		
		foreach ($topicArray->get() as $topic)
		{
			$topicLink = NavigationView::getTopicLink($topic);
			$ret .= "<a href='$topicLink' class='listHeader'>" . $topic->getHeader() . "</a>
					 <p class='nameAndDate'>By " . $topic->getUserName() . " " . $topic->getDate() . "</p>";
		}
		
		$ret .= "</ul>";
		
		return $ret;
	}
	
	public function RenderTopic(Topic $topic)
	{
		$ret =  "<div class='thread'><h2>" . $topic->getHeader() . "</h2>";
		$ret .= "<p class='nameAndDate'>By " . $topic->getUserName() . " " . $topic->getDate() . "</p>";
		$ret .= "<p class='topicContent'>" . $topic->getContent() . "</p></div>";
		
		return $ret;
	}
		
}


?>